<?php
/**
 * @version     1.0.1
 * @package     com_ganeshavereadores
 * @copyright  	
 * @license     
 * @author      Jorge Eduardo
 */
// No direct access to this file
defined('_JEXEC') or die('Restricted access');

JHtml::_('behavior.tooltip');
JHtml::_('behavior.formvalidation');
JHtml::_('behavior.keepalive');




						$db =& JFactory::getDBO();
						$sql = 'SELECT distinct a.id, a.nome FROM #__ganeshavereadores_categoria a left join #__ganeshavereadores_proposicoes b on b.categoria=a.id where '; 
						if($filter_vereador)
							$sql .= ' b.vereador='.$filter_vereador;
						else
							$sql .= ' b.vereador=0';
							
						$db->setQuery($sql);
						$categorialist[] = JHTML::_('select.option',  '0', JText::_( ' Selecione uma Atividade ' ), 'id', 'nome' );
						$categorialist = array_merge( $categorialist, $db->loadObjectList() );
					?>		
					
					sjhjhfkjh				
					<select name="filter-categoria" id="filter-categoria" onchange="document.adminForm.submit();">
						<?php foreach ($categorialist as $categoria) :?>
							<option value="<?php echo $categoria->id ?>"  <?php if($categoria->id == $filter_categoria) echo 'selected="true"'?>><?php echo $categoria->nome ?></option>						
						<?php endforeach;?>
					</select>
					